<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.misc.*" %>

<%@ include file="../init_include.jsp" %>

<%
	int check_rst=Permission.accept(dbi,session,request,"sysop","tree","catid","100000000"); 	
	if (check_rst!=Permission.CHECK_RST_SUCCESS) {
		dbi.closeAll();
		if (check_rst==Permission.CHECK_RST_DENY)
			response.sendRedirect("../deny.html");
		else
			response.sendRedirect("../index.jsp");
		return;		
	}
	
	Sysop sysop=(Sysop)session.getAttribute("sysop");
		
	int catid=0;
	String curpath="",code="";
	try {	
		catid=Request.getInt("catid");
		if(catid>0) {
			Category cat=new Category(dbi,catid);
			curpath=cat.getPath();
			code=cat.getModulecode();
		}			
	} catch (Exception E) {
		out.println(E.getMessage());
		return ;
	}
	if(code.length()==0 || code.equals("other"))
		code=Request.getString("modulecode");	

	CategoryInfo cInfo=new CategoryInfo(code,catid);
	String newName[]=cInfo.getNewName();	
	String sourceName[]=cInfo.getSourceName();
	String field[]=cInfo.getField();	
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
<link rel="stylesheet" href="../css.css" type="text/css">
<SCRIPT language=JavaScript1.2 src="../script/editor.js"></SCRIPT>
<script language="JavaScript1.2">
<!--
	function setDefaultValue()
	{
		<% for(int i=0;i<sourceName.length;i++) {%>
			 		document.formIon.<%=field[i]%>.value="<%=sourceName[i]%>";
		<% }%>
	}
-->
</script>
<title><%=Language.getNameByCode("sys.categoryinfo","Category Info add or edit")%></title>
</head>
<body>
<%=Language.getNameByCode("sys.CurrentPos","Current Position")%>:<%=Language.getNameByCode("sys.categoryinfo","Category Info add or edit")%><br> 
<hr>   
 <table width="100%" border="0" cellspacing="1" cellpadding="2" class="input_title">
	 <form method="post" name="formIon" action="categoryinfo_addmod.jsp">
   <tr>
     <td>&nbsp;<%=Language.getNameByCode("sys.modulename","Module Name")%>:<input type="text" name="<%=field[0]%>" value="<%=newName[0]%>"></td>
   </tr>
 </table>
   <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#666666">
   <%for (int i=1;i<sourceName.length;i++) {%>
   <tr class="bgcolor_title_tr"> 
     <td width="60" class="input_title" align="right">&nbsp;<%=sourceName[i]%>: </td>
     <td> 
       <input type="text" name="<%=field[i]%>" maxlength="255" size="46" value="<%=newName[i]%>">
     </td>
   </tr>
   <%}%>
 </table>
 <input type="submit" name="Submit" style="width=80" value="<%=Language.getNameByCode("sys.Submit","Submit")%>">
 <input type="Reset" name="Reset" style="width=80" value="<%=Language.getNameByCode("sys.Reset","Reset")%>">
 <input type="button" name="default" style="width=80" value="<%=Language.getNameByCode("sys.Default","Default")%>" onClick="setDefaultValue();">
 <input type="button" name="close" style="width=80" value="<%=Language.getNameByCode("sys.Close","Close")%>" onClick="self.close();"> 
 <input type="hidden" name="catid" value="<%=catid%>">
 <input type="hidden" name="modulecode" value="<%=code%>">
 </form>
</body>                
</html>        
<%@ include file="../init_free.jsp" %>        
